#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMenuBar>
#include <QMenu>
#include<QAction>
#include<QTextEdit>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QMenuBar* menuBar = new QMenuBar(this);
    this->setMenuBar(menuBar);
    QMenu* m1 = new QMenu("文件");
    QMenu* m2 = new QMenu("编辑");
    QMenu* m3 = new QMenu("构建");
    menuBar->addMenu(m1);
    menuBar->addMenu(m2);
    menuBar->addMenu(m3);
    QAction* act2 = new QAction("打开文件");
    QAction* act1 = new QAction("创建新文件");
    m1->addAction(act1);
    m1->addSeparator();
    m1->addAction(act2);
}

MainWindow::~MainWindow()
{
    delete ui;
}

